import numpy as np


# (3 ,4)
a = np.array([
    [1, 4, 2, 5],
    [5, 6, 7, 8],
    [9, 10, 12, 13]
])
# (3, 4)
c = np.array([
    [8, 7, 255, 6],
    [5, 255, 255, 255],
    [3, 5, 255, 255]
])
'''
要求最后的数据
a = [[1 4 255 5]
    [5 255 255 255]
    [9 10 255 255]]
'''
# b = np.zeros((3, 4))
# cal, row =a.shape
# for i in range(3):
#     for j in range(4):
#         if(c[i][j]) == 255):
#             b[i][j] = c[i][j]
#         else:
#             b[i][j] = a[i][j]
# print(b)


# index = c == 255
# a[index] = 255
# print(a)


index = np.where(c == 255)
# print(index)
# (array([0, 1, 1, 1, 2, 2], dtype=int64), array([2, 1, 2, 3, 2, 3], dtype=int64))

a[index] = 255
print(a)
















